﻿using System;
using System.Windows.Data;

namespace AnthStat.WPF.Applications.Converters
{
    public sealed class ChartMeasurementToYAxisEndMultiConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string measurement = values[0].ToString();
            string reference = values[1].ToString();

            if (measurement.Equals("BodyMassIndex", StringComparison.OrdinalIgnoreCase))
            {
                return 32.0;
            }

            if (measurement.Equals("Weight", StringComparison.OrdinalIgnoreCase))
            {
                if (reference.Equals("CDC", StringComparison.OrdinalIgnoreCase))
                {
                    return 110.0;
                }
                else
                {
                    return 60.0;
                }
            }

            if (measurement.Equals("Height", StringComparison.OrdinalIgnoreCase))
            {
                return 210.0;
            }

            if (measurement.Equals("HeadCircumference", StringComparison.OrdinalIgnoreCase))
            {
                return 55.0;
            }

            if (measurement.Equals("MidUpperArmCircumference", StringComparison.OrdinalIgnoreCase))
            {
                return 23.0;
            }

            return 0.0;
        }

        public object[] ConvertBack(object values, Type[] targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
